<?php
return array(
    '_id' => 'block',
    '_form' => array(
        'method' => 'post',
        'class' => array(),
        'accept-charset' => 'utf-8',
        'role' => 'form',
        'ajax-submit' => '#right_handle'
    ),
    'id' => array(
        'label' => '机读名',
        'error' => '',
        'userOptions' => array(),
        'description' => '机读名',
        'widget' => 'Text',
        '_access' => [
            //'addForm' => true,
            'edit' => false,
        ],
        'filter' => array('striptags'),
        'validate' => array(),
        'attributes' => array(
            'class' => 'form-control',
        ),
        'required' => true,
    ),
    'name' => array(
        'label' => '区块名',
        'error' => '',
        'userOptions' => array(),
        'description' => '',
        'widget' => 'Text',
        'validate' => array(),
        'filter' => array('striptags'),
        'attributes' => array(
            'class' => 'form-control',
        ),
        'required' => true,
    ),
    'loadType' => array(
        'label' => '加载方式',
        'error' => '',
        'userOptions' => array(),
        'description' => '',
        'field' => 'string',
        'widget' => 'Select',
        'validate' => array(),
        'options' => [
            'default' => '默认',
            'ajax' => 'Ajax加载'
        ],
        'filter' => array('striptags'),
        'attributes' => array(
            'class' => 'form-control',
        ),
        'required' => true,
    ),

    'cache' => array(
        'label' => '缓存时间',
        'error' => '',
        'userOptions' => [],
        'description' => '内容缓存时间，如果不缓存请设置为0',
        'widget' => 'Numeric',
        'validate' => [],
        'default' => 0,
        'filter' => array('intval'),
        'attributes' => array(
            'class' => 'form-control',
        ),
        'required' => true,
    ),
    'base' => array(
        'field' => 'group',
        'widget' => 'Group',
        'label' => '显示和权限',
        'description' => '',
        'error' => '',
        'access' => array(),
        'attributes' => array(),
        'right' => true,
        'group' => array(
            'displayTitle' => array(
                'widget' => 'Select',
                'access' => [],
                'required' => false,
                'description' => '显示区块标题',
                'error' => '',
                'options' => ['不显示', '显示'],
                'right' => 'true',
                'label' => '显示标题',
                'filter' => ['boolval'],
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'device' => array(
                'widget' => 'Selects',
                'access' => [],
                'required' => false,
                'description' => '只为指定设备显示区块，ajax加载模式下有效',
                'error' => '',
                'options' => [
                    'pc' => 'PC电脑',
                    'tablet' => '平板电脑',
                    'phone' => '移动手机'
                ],
                'right' => 'true',
                'label' => '设备显示',
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'path' => array(
                'widget' => 'Tags',
                'required' => false,
                'description' => '只为指定页面显示该区块，支持正则，以 ; 隔开',
                'error' => '',
                'right' => 'true',
                'default' => [],
                'label' => '显示页面',
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'expath' => array(
                'widget' => 'Tags',
                'length' => 10,
                'required' => false,
                'default' => [],
                'label' => '隐藏页面',
                'description' => '在指定页面隐藏该区块，支持正则，以 ; 隔开',
                'error' => '',
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'roles' => array(
                'field' => 'string',
                'widget' => 'Selects',
                'options' => getRolesOptions(),
                'required' => false,
                'label' => '为指定角色显示该区块',
                'description' => '',
                'default' => [],
                'error' => '',
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'exroles' => array(
                'field' => 'string',
                'widget' => 'Selects',
                'options' => getRolesOptions(),
                'required' => false,
                'label' => '为指定角色隐藏该区块',
                'description' => '',
                'error' => '',
                'default' => [],
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
        ),
    ),
    '_options' => array(
        'success' => '保存区块成功',
        'error' => '保存区块失败'
    )
);